package net.learn.vocabulary;

import android.app.Activity;
import android.app.WallpaperManager;
import android.content.Context;
import android.content.Intent;
import android.graphics.Point;
import android.os.Bundle;
import android.view.Display;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class Main extends Activity {
    /** Called when the activity is first created. */
	public Context mContext;
	public ListView mList;
	static final String[] listLeson = new String[] {"Lesson 1","Lesson 2","Lesson 3","Lesson 4","Lesson 5",
		"Lesson 6","Lesson 7","Lesson 8","Lesson 9","Lesson 10"};
    public WallpaperManager wallpaperManager;
    public static int width;
    public static int height;
    public static int text_width;
    public static int text_height;
    public static int text_size;
	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        /***Get Revolution ***/
        Display display = getWindowManager().getDefaultDisplay();
        Point size = new Point();
        display.getSize(size);
        width = size.x;
        height = size.y;
        text_width = width/3;
        text_height = height/5;
        text_size = height/25;
        mContext = getApplicationContext();
        mList = (ListView)findViewById(R.id.listmain);
        mList.setAdapter(new ArrayAdapter<String>(mContext, android.R.layout.simple_list_item_1,listLeson));
        mList.setOnItemClickListener(new OnItemClickListener() {
			@Override
			public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
					long arg3) {
				// TODO Auto-generated method stub
				Intent i = new Intent(mContext,struct.class );
				Bundle extras = new Bundle();
				extras.putString("lesson", Integer.toString(arg2));
				i.putExtras(extras);				
				startActivity(i);
			}
		});
       
    }
}